# 字符串操作
s1 = 'Python'
# 获取字符串长度
# print(len(s1))
# 访问字符串中的字符
# print(s1[0], s1[1], s1[-1], s1[-2])
# print(s1[-8])  # 下标不能超出范围


s2 = 'WelcomeToChina'

# print(s2[::2])
# 下标使用负数
# print(s2[::-1])
print(s2[::-2])
# # 切片
# print(s2[3:7])  # come
# print(s2[-5:]) # China
# # 切前7个
# # 开始为0可以省略
# print(s2[:7])
# print(s2[:7:2])




